package com.wuyou.spring_demo.service;

import com.wuyou.spring_demo.bean.Animal;

/**
 * AnimalServiceImpl
 *
 * @Date 2025/7/9 14:52
 * @Author 无忧
 */
public class AnimalServiceImpl implements AnimalService{

    private Animal animal;

    public AnimalServiceImpl() {
        super();
    }

    public AnimalServiceImpl(Animal animal) {
        this.animal = animal;
        System.out.println("构造方法注入");
    }

    public void setAnimal(Animal animal) {
        this.animal = animal;
        System.out.println("setter注入");
    }

    @Override
    public String roar(String howRoar) {
        return animal.getName() + "是这样叫的->" + howRoar;
    }
}
